//
//  BSSBankListTableViewCell.m
//  PreschoolEducation
//
//  Created by 李传铎 on 2020/11/15.
//  Copyright © 2020 李传铎. All rights reserved.
//

#import "BSSBankListTableViewCell.h"

@implementation BSSBankListTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.contentView.backgroundColor = [UIColor clearColor];
        [self createUI];
        [self layoutUI];
    }
    return self;
}

- (void)createUI {
    
    [self.contentView addSubview:self.mainImageV];
    [self.contentView addSubview:self.titleL];
    [self.contentView addSubview:self.detailsL];
    
    
}

- (void)layoutUI {
    
    
    
    [self.mainImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(18);
        make.width.mas_equalTo(38);
        make.height.mas_equalTo(31);
        make.bottom.mas_equalTo(-16);
    }];
    
    [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mainImageV.mas_right).offset(10);
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(12);
        
    }];
    
    [self.detailsL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mainImageV.mas_right).offset(10);
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(self.titleL.mas_bottom).offset(2);
       
    }];
    
}

- (UIImageView *)mainImageV{
    if (!_mainImageV) {
        _mainImageV = [UIImageView new];
        _mainImageV.image = imageNameStr(@"ic_bank_big");
    }
    return _mainImageV;
}
- (UILabel *)titleL{
    if (!_titleL) {
        _titleL = [UILabel new];
        _titleL.text = @"中国银行";
        _titleL.textColor = colorCode(@"#333333");
        _titleL.font = [UIFont boldSystemFontOfSize:16];
    }
    return _titleL;
}
- (UILabel *)detailsL{
    if (!_detailsL) {
        _detailsL = [UILabel new];
        _detailsL.text = @"尾号2873的储蓄卡";
        _detailsL.textColor = colorCode(@"#666666");
        _detailsL.font = fontCount(12);
    }
    return _detailsL;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
